/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Generation.GenerationDynamics.impl;

import EA_Model.IEC61970.Core.impl.PowerSystemResourceImpl;

import EA_Model.IEC61970.Generation.GenerationDynamics.GenerationDynamicsPackage;
import EA_Model.IEC61970.Generation.GenerationDynamics.PrimeMover;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Prime Mover</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Generation.GenerationDynamics.impl.PrimeMoverImpl#getPrimeMoverRating <em>Prime Mover Rating</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class PrimeMoverImpl extends PowerSystemResourceImpl implements PrimeMover {
	/**
	 * The cached value of the '{@link #getPrimeMoverRating() <em>Prime Mover Rating</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPrimeMoverRating()
	 * @generated
	 * @ordered
	 */
	protected EA_Model.IEC61970.Domain.Float primeMoverRating;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected PrimeMoverImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return GenerationDynamicsPackage.Literals.PRIME_MOVER;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float getPrimeMoverRating() {
		if (primeMoverRating != null && primeMoverRating.eIsProxy()) {
			InternalEObject oldPrimeMoverRating = (InternalEObject)primeMoverRating;
			primeMoverRating = (EA_Model.IEC61970.Domain.Float)eResolveProxy(oldPrimeMoverRating);
			if (primeMoverRating != oldPrimeMoverRating) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, GenerationDynamicsPackage.PRIME_MOVER__PRIME_MOVER_RATING, oldPrimeMoverRating, primeMoverRating));
			}
		}
		return primeMoverRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EA_Model.IEC61970.Domain.Float basicGetPrimeMoverRating() {
		return primeMoverRating;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPrimeMoverRating(EA_Model.IEC61970.Domain.Float newPrimeMoverRating) {
		EA_Model.IEC61970.Domain.Float oldPrimeMoverRating = primeMoverRating;
		primeMoverRating = newPrimeMoverRating;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, GenerationDynamicsPackage.PRIME_MOVER__PRIME_MOVER_RATING, oldPrimeMoverRating, primeMoverRating));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case GenerationDynamicsPackage.PRIME_MOVER__PRIME_MOVER_RATING:
				if (resolve) return getPrimeMoverRating();
				return basicGetPrimeMoverRating();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case GenerationDynamicsPackage.PRIME_MOVER__PRIME_MOVER_RATING:
				setPrimeMoverRating((EA_Model.IEC61970.Domain.Float)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case GenerationDynamicsPackage.PRIME_MOVER__PRIME_MOVER_RATING:
				setPrimeMoverRating((EA_Model.IEC61970.Domain.Float)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case GenerationDynamicsPackage.PRIME_MOVER__PRIME_MOVER_RATING:
				return primeMoverRating != null;
		}
		return super.eIsSet(featureID);
	}

} //PrimeMoverImpl
